<style type="text/css">
    .layui-table-body {
        overflow-x: auto;
    }

    .layui-table-cell {
        font-size: 12px;
    }
</style>
<div class="page-toolbar">
    <div class="page-filter fr">
        <form class="layui-form layui-form-pane" action="{:url()}" id="hisiSearch" method="get">
            <div class="layui-form-item">
                <label class="layui-form-label">搜索</label>
                <div class="layui-input-inline">
                    <input type="text" name="keyword" value="" lay-verify="required" placeholder="名称" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
        </form>
    </div>
</div>
<form id="pageListForm">
    <div class="layui-form">
        <table id="dataTable"></table>
        <script type="text/html" id="statusTpl">
            {{ d.audit }}
        </script>
        <script type="text/html" title="操作按钮模板" id="buttonTpl">
            <!--<a href="{:url('view')}?currency_id={{ d.currency_id }}" class="layui-btn layui-btn-xs layui-btn-normal">查看</a>--><a href="{:url('tokenEdit')}?currencyId={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal">修改</a><a href="{:url('status')}?id={{ d.id }}&table=currency" class="layui-btn layui-btn-xs layui-btn-danger j-tr-del">删除</a>
        </script>
    </div>
</form>
{include file="block/layui" /}
<script type="text/javascript">
    layui.use(['table'], function () {
        var table = layui.table;
        table.render({
            elem: '#dataTable'
            , url: '{:url()}' //数据接口
            , page: true //开启分页
            , limit: 20
            , text: {
                none: '暂无相关数据'
            }
            , cols: [[ //表头
                {type: 'checkbox'}
                , {field: 'id', title: 'Token编号', width: 120}
                , {field: 'name', title: '班级名称', templet: '#nameTpl'}
                , {
                    field: 'currency_name', title: 'Token名称', width: 120
                }
                , {
                    field: 'currency_mark', title: 'Token简称', width: 120
                }
                , {field: 'currency_all_num', title: 'Token总量'}
                , {field: 'contract_address', title: 'Token合约地址'}
                , {field: 'fee', title: '提现手续费(%)'}
                , {field: 'last_price', title: '最新价(vns)', templet: function (d) {
                    if(d.id > 2){
                        return d.last_price;
                    }else{
                        return "";
                    }
                }}
                , {field: 'ctime', title: '创建时间', width: 100}
                , {title: '操作', width: 220, templet: '#buttonTpl'}
            ]]
        });
    });
</script>